package com.jl.smartcard.ui.views.filesystem;

import java.util.ArrayList;


class TreeDF extends TreeEF {

	private static final long serialVersionUID = 767594863754038704L;
	private ArrayList<TreeEF> children;

	public TreeDF(String name) {
		super(name);
		children = new ArrayList<TreeEF>();
	}

	public void addChild(TreeEF child) {
		if(!children.contains(child)){
			children.add(child);
			child.setParent(this);
		}
	}

	public void removeChild(TreeEF child) {
		children.remove(child);
		child.setParent(null);
	}

	public TreeEF[] getChildren() {
		return children.toArray(new TreeEF[children.size()]);
	}

	public boolean hasChildren() {
		return children.size() > 0;
	}

	public void removeAll() {
		children.clear();
	}
}